package com.xj0927.springcloud.controller;

import com.xj0927.springcloud.entities.CommonResult;
import com.xj0927.springcloud.entities.Payment;
import com.xj0927.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: xj0927
 * @Description:
 * @Date Created in 2020-10-28 18:54
 * @Modified By:
 */
@RestController
@Slf4j
public class PaymentController {

    @Resource
    private PaymentFeignService paymentFeignService; //表示使用openfeign进行调用

    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id")Long id){
        return paymentFeignService.getPaymentById(id);
    }
    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut(){
        return paymentFeignService.paymentFeignTimeOut();
    }
}
